package com.stefanie.eventlistenerdemo.listener;

import com.stefanie.eventlistenerdemo.domain.event.UserEvent;
import com.stefanie.eventlistenerdemo.listener.core.EventListener;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author: stefanie-zy
 * @time: 2024/1/12-15:26
 * @description: 监听器-用户
 */
@Component
@Slf4j
public class UserEventListener implements EventListener<UserEvent> {
    @Override
    public void onEvent(UserEvent event) {
        log.info("User listener:Send an email to user {} at address {}", event.getUserDto().getUserName(), event.getUserDto().getEmail());
    }
}
